home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2006 May
/
PCWMAY06.iso
/
Software
/
Resources
/
HTMLGate 12.2.1B
/
htmlgate.exe
/
{app}
/
Cookies
/
cookie11.txt
< prev
next >
Wrap
Text File
|
2002-09-26
|
1KB
|
33 lines
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide from older browsers
var cookieObject = document.cookie; // retrieve cookie string
function getCookie(name) { // use: getCookie("name");
var index = cookieObject.indexOf(name + "=");
if (index == -1) return null;
index = cookieObject.indexOf("=", index) + 1;
var endstr = cookieObject.indexOf(";", index);
if (endstr == -1) endstr = cookieObject.length;
return unescape(cookieObject.substring(index, endstr));
}
var today = new Date();
var expiry = new Date(today.getTime() + 28 * 24 * 60 * 60 * 1000); // 28 days
function setCookie(name, value) { // use: setCookie("name", value);
if (value != null && value != "")
document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString();
cookieObject = document.cookie; // update cookieObject
}
var today = new Date();
var expired = new Date(today.getTime() - 48 * 60 * 60 * 1000); // less 2 days
// Delete cookie with given name
function deleteCookie(attribute) {
document.cookie=attribute + "=null; expires=" + expired.toGMTString();
bikky = document.cookie; }
-->
</SCRIPT>